package com.jianwei.configuration;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * @author wjwei
 */
@ConfigurationProperties(prefix = "id-generator.segment")
public class SegmentConfiguration {

    private Boolean enable;

    private List<String> dbList;

    private Integer fetchSegmentRetryTimes;

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public List<String> getDbList() {
        return dbList;
    }

    public void setDbList(List<String> dbList) {
        this.dbList = dbList;
    }

    public Integer getFetchSegmentRetryTimes() {
        return fetchSegmentRetryTimes == null ? 2 : fetchSegmentRetryTimes;
    }

    public void setFetchSegmentRetryTimes(Integer fetchSegmentRetryTimes) {
        this.fetchSegmentRetryTimes = fetchSegmentRetryTimes;
    }
}
